﻿Ext.define('Department', {
    extend: 'Ext.data.Model',
    fields: [
        "Id"
		, "Name"   //部门名称
		, "ParentID"   //上级部门
		, "Dlevel"   //级别
		, "Remarks"   //备注

    ],
    idProperty: "Id"
})

Ext.define("SHApp.ClientInfo.ContractManage.HROComboBox", {
    extend: "BLBTSystem.CmbData",
    alias: "widget.hrocombobox",
    dataUrl: "api/department?format=json",
    model: "Department",
    matchFieldWidth: false,
    sorters: [{
        property: 'Name',
        direction: 'ASC'
    }],
    listConfig: {
        resizable: true,
        width: 300
    },
    minChars: 1,
    valueField: "Id",
    displayField: "Name",
    maxLength: 100,
    forceSelection: false,
    initComponent: function () {
        Ext.apply(this);
        this.callParent(arguments);
    }
    //    loadByGroup: function (groupName) {
    //        this.dataUrl = "api/departmenttree?format=json";
    //        this.reLoadData();
    //    }
});